package cvo.pro4.chess.client.pocDragDrop.WorkJo;

import java.awt.TextField;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class BasicWidget extends Widget {

	public BasicWidget(String Buttontext, String LabelText) {
		this.button = new Button();
		//this.button.addClickHandler(new HandlerExample());
		this.textfield = new TextField();
		this.label = new Label();
		
		this.button.setText(Buttontext);
		this.label.setText(LabelText);
		//Init mag maar 1 keer worden opgeroepen.
		//initWidget(uiBinder.createAndBindUi(this));
	}

	
	private TextField textfield;
	protected Button button;
	private Label label;


	@UiHandler("button")
	void onClick(ClickEvent e) {
		Window.alert("Hello!");
	}
	
	public String getTextField(){
		return textfield.getText();
	}
	
	public void setLabel(String text){
		this.label.setText(text);
	}

}
